<script>
  function numeric_sort(e1,e2)
  {
    return (e2-e1)
  }

  var array1=new Array(3,5,1,6,2,4)
  document.write("<b>array1(Before:)</b>"+array1.join(" "))
  array1.sort(numeric_sort)
  document.write("<p><b>array1 (After:)</b>"+array1.join(" "))
</script>
